<?php

$servername = "localhost";
$sqlusername = "user1";
$sqlpassword = "123456";
$dbname = "user1";

// 创建连接
$conn = new mysqli($servername, $sqlusername, $sqlpassword, $dbname);

// 检查连接
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

// 设置字符集
$conn->set_charset("utf8mb4");

// 查询游戏列表
$sql = "SELECT * FROM game WHERE zt = 1 ORDER BY vip ASC";
$game = $conn->query($sql);

// 添加错误处理
if (!$game) {
    die("查询失败: " . $conn->error);
}

?>